from django.db import models


# Create your models here.

class Student(models.Model):
    name = models.CharField(max_length=100, verbose_name='学生姓名')
    sex = models.CharField(max_length=10, choices=(('M', '男'), ('F', '女')), verbose_name='性别')
    age = models.IntegerField(verbose_name='年龄')
    address = models.TextField(verbose_name='家庭住址')
    enter_date = models.DateField(verbose_name='入学时间')
    remarks = models.TextField(blank=True, null=True, verbose_name='备注')
    email = models.EmailField(max_length=254, blank=True, null=True, verbose_name='电子邮件')  # 新增的邮箱字段

    class Meta:
        verbose_name = '学生'
        verbose_name_plural = '学生信息'
        db_table = 'students'

    def __str__(self):
        return self.name
